<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>mindsensors-nxtcam.h File Reference</h1>  </div>
</div>
<div class="contents">

<p>Mindsensors NXTCam driver.  
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="common_8h_source.html">common.h</a>&quot;</code><br/>

<p><a href="mindsensors-nxtcam_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structblob.html">blob</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga3104c35d33ecdfdcaa2af97f1691df8a">MAX_BLOBS</a>&#160;&#160;&#160;8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga36fbe48f1799ef0af9efab553c0bd9c9">NXTCAM_I2C_ADDR</a>&#160;&#160;&#160;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gad16acce76c61ecff2aec7e38ba6537cf">NXTCAM_CMD_REG</a>&#160;&#160;&#160;0x41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga87f344485cd003c785b54959c883b924">NXTCAM_COUNT_REG</a>&#160;&#160;&#160;0x42</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gadd6a460c504511474edf8a6f4e9687a6">NXTCAM_DATA_REG</a>&#160;&#160;&#160;0x43</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaac63b3236275d61b690cb17ea7634072">SIDE_CENTER</a>(X1, X2)&#160;&#160;&#160;((X1 + X2) / 2)</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structblob.html">blob</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> [MAX_BLOBS]</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa9503a35f45a1ffa5b298c65e95badf0">NXTCAMinit</a> (tSensors link, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga47cb3406f218eeb9e9711d0a7184e410">NXTCAMinitTL</a> (tSensors link, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga5259766d6514ee73a08421ac88e77b12">NXTCAMgetBlobs</a> (tSensors link, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, bool mergeBlobs, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaad3f1f7dadba3f8386b4756ce9f1888f">NXTCAMgetBlobs</a> (tSensors link, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga37e1ce7e64e571b7c3480404462d67e7">_camera_cmd</a> (tSensors link, byte cmd, ubyte address)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gadb70d2a4b3e24685060d2bcf95d9b473">_mergeBlobs</a> (int blob1, int blob2, int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga444410109e39138d52242c0570b5d0f9">_merge</a> (int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga1d6f5eddd1d996914310d608d031664e">_sortBlobs</a> (int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga177c2ae2e5fcc598179d2289b3a420df">NXTCAMgetAverageCenter</a> (<a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, int nblobs, int colourindex, int &amp;x, int &amp;y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga6ca36236d45c9cdc7bbc56f266bdf6c6">NXTCAMgetCenter</a> (<a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, int index, int &amp;x, int &amp;y)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa1d603a296a06a71f002d0535d5e14fb">NXTCAM_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gabb37063af562082aa6d0b0bf50278b6e">NXTCAM_I2CReply</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga02fd1071ae1b5e8665557ab086c33112">still_merging</a> = false</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Mindsensors NXTCam driver. </p>
<p><a class="el" href="mindsensors-nxtcam_8h.html" title="Mindsensors NXTCam driver.">mindsensors-nxtcam.h</a> provides an API for the Mindsensors NXTCam. This version is an extensive rewrite of Gordon Wyeth's driver. The blob information is no longer kept in seperate array, but in an array of structs.</p>
<p>Changelog:</p>
<ul>
<li>1.0: Partial rewrite of original driver, using structs instead of arrays to hold blob info</li>
<li>1.1: Further rewrite to use <a class="el" href="common_8h.html" title="Commonly used functions used by drivers.">common.h</a> functions to further align with standard driver framework</li>
<li>1.2: Added <a class="el" href="group__nxtcam.html#ga6ca36236d45c9cdc7bbc56f266bdf6c6">NXTCAMgetCenter()</a> to calculate the center of a single blob</li>
<li>1.3: Added <a class="el" href="group__nxtcam.html#ga47cb3406f218eeb9e9711d0a7184e410">NXTCAMinitTL()</a> to enable line tracking mode<br/>
 Fixed bug in <a class="el" href="group__nxtcam.html#gaa9503a35f45a1ffa5b298c65e95badf0">NXTCAMinit()</a> that did not configure object tracking properly<br/>
 Added extra wait times after each issued command in init functions</li>
<li>1.4: Removed printDebugLine from driver</li>
<li>1.5: Added ability to specify I2C address with optional argument. Defaults to 0x02 when not specified.</li>
</ul>
<p>License: You may use this code as you wish, provided you give credit where it's due.</p>
<p>THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Xander Soldaat </dd>
<dd>
Gordon Wyeth </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>03 Dec 2010 </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd>1.5 </dd></dl>

<p>Definition in file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:43 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
